<?php
    //include 加载模块组件
    include "library/demo.php";
    //require("demo.php");
    //echo com1();

    //实现接口
    function a1(){
        class Site {
            private $sites = array(
                1 => 'TaoBao',
                2 => 'Google',
                3 => 'Runoob',
                4 => 'Baidu',
                5 => 'Weibo',
                6 => 'Sina'

            );
            public function getAllSite(){
                return $this->sites;
            }
            public function getSite($id){
                $site = array($id => ($this->sites[$id]) ? $this->sites[$id] : $this->sites[1]);
                return $site;
            }
        }

        $obj = new Site();
        var_dump($obj->getSite(9));
    }
    a1();

?>